feat(layout): support listener, loader, and component modifiers - #307
Merged
Merged
Conversation
wpoortman
added this pull request to stack #309
September 22, 2026 17:07
wpoortman
commented
Sep 23, 2026
| ) { | ||
| } | ||
|
|
||
| public function getComponent(): Component |
Collaborator
Author
There was a problem hiding this comment.
Since we return a object, dont use get, just make the method component()
wpoortman
commented
Sep 23, 2026
| return $this->component; | ||
| } | ||
|
|
||
| public function getArguments(): MagewireArguments |
Collaborator
Author
There was a problem hiding this comment.
Since it returns an object, we don't need a get, we can just use arguments() as a method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LayoutArgumentOverlay, so features can opt into per-placement values without duplicating merge logic.false/nullremovals throughmagewire:listeners.nullremovals throughmagewire:loader;falseremains a valid loader value.ModifierInterfaceobjects throughmagewire:modifiers. The interface extends Magento's blockArgumentInterfacefor layout object resolution. Each modifier receives aComponentModifierContextwith the component and the genericMagewireArgumentscollection; the context can expose other build data later without changing the interface.Phrasevalues in loader effects. PHP modifier messages remain visible toi18n:collect-phrases.Architecture
LayoutArgumentOverlayreads resolver arguments, replaces scalar values, appends list entries, and merges named entries with consumer-selected removal values. Event-specific listener normalization and dispatch guards remain in SupportMagewireEvents. The loader feature uses the same overlay before translating and dehydrating its effect, without mutating the component property.ComponentModifierRunnerapplies declared modifiers in array order after block arguments are assembled and before component assembly, mount, or hydration. Modifiers can useMagewireArguments::get()andmerge()to change any argument or change the component directly. Conditions can inspect Magento services and the component's initialized state at that point; snapshot state has not yet been hydrated.Active layout handlers are contributed during the event adapter boot hook, before server calls and dehydration. Tombstoned dispatches are rejected by a pre-call guard, and the adapter later filters the initial browser listener effect during dehydration. If core events are disabled, the adapter skips itself.
Listener precedence remains component listeners, then On attributes, then the layout overlay. Tombstones are resolved before dynamic placeholders are expanded. Whole-map clearing and live post-mount reconciliation remain out of scope.
Verification
git diff --checkpass locally.i18n:collect-phrasesfinds both PHP modifier messages./magewire/playwright/eventsroute and Playwright spec exercise XML listeners, the loader overlay, and the modifier object (including PHP-computed listeners and Phrase messages); GitHub CI runs them against Magento.